package mt.comm;

import java.io.Serializable;

import mt.Order;



public class ClientMsg implements ClientSideMessage, Serializable {

	private Type type;
	private Order order;
	private String error;
	private static final Long ID = 12355657L;
	
	/**
	 * constructor associated with sending the message from the client to the server
	 * 
	 * @param type The type of message
	 * @param order The order which is being sent
	 * @param error The error sending
	 */
	
	public ClientMsg(Type type, Order order, String error) {
		super();
		this.type = type;
		this.order = order;
		this.error = error;
	}
	/**
	 * Method associated with getting the message type
	 * @return Type type
 	 */

	@Override
	public Type getType() {
		return type;
	}
	/**
	 * Method associated with obtaining the order in which the message was sent
	 * @return Order order
	 */

	@Override
	public Order getOrder() {
		return order;
	}
/**
 * Method associated with obtaining the error found
 * @return String error
 */
	@Override
	public String getError() {
		return error;
	}
	
	/**
	 * Method to string
	 * @return the String of the message sent;
	 */

	@Override
	public String toString() {
		return "ClientMsg [type=" + type + ", order=" + order + ", error="
				+ error + "]";
	}

}
